﻿package view.tips
{
    import morn.core.components.*;
    import morn.core.handlers.*;
    import uiresource.tips.*;
    import view.mornExtends.*;
    import vo.*;

    public class Hdtips extends HDviewUI
    {
        private var cfgitem:Object;

        public function Hdtips()
        {
            this.cfgitem = ConfigDictionary.data.item;
            return;
        }// end function

        public function set data(param1:Object) : void
        {
            var _loc_5:Array = null;
            var _loc_6:int = 0;
            var _loc_7:Object = null;
            txt_state.isHtml = true;
            txt_state.text = param1.name + " <font color=\'#e19f21\'>活动奖励：</font>";
            var _loc_2:* = param1.items;
            var _loc_3:Array = [];
            var _loc_4:Boolean = false;
            if (_loc_2 && _loc_2 != "" && _loc_2 != "null")
            {
                _loc_5 = _loc_2.split("#");
                for each (_loc_6 in _loc_5)
                {
                    
                    _loc_7 = new Object();
                    _loc_7.itemid = _loc_6;
                    if (this.cfgitem[_loc_7.itemid])
                    {
                        _loc_7.icon = this.cfgitem[_loc_7.itemid].icon;
                    }
                    _loc_3.push(_loc_7);
                }
            }
            if (_loc_3.length > 5)
            {
                bg.height = 153;
            }
            else
            {
                bg.height = 100;
            }
            list_goods.array = _loc_3;
            list_goods.renderHandler = new Handler(this.rmRender);
            return;
        }// end function

        private function rmRender(param1:Component, param2:int) : void
        {
            var _loc_3:Object = null;
            var _loc_4:Object = null;
            if (param2 < list_goods.length)
            {
                _loc_3 = list_goods.array[param2];
                _loc_4 = null;
                if (this.cfgitem[_loc_3.itemid])
                {
                    _loc_4 = ItemObject.create(this.cfgitem[_loc_3.itemid]);
                }
                (param1 as FlashItem).effshow = true;
                (param1 as FlashItem).data = _loc_4;
            }
            return;
        }// end function

    }
}
